<!-- 积分奖励 -->
<template>
    <div>
        <div>
            <a-form :label-col="{ span: 6 }" :wrapper-col="{ span: 17 }">
                 <a-form-item label="提现是否审核">
                        <a-radio-group v-model="status" >
                            <a-radio  v-for="(item,i) in isHideList" :key="i" :value="item.id">{{item.name}}</a-radio>
                        </a-radio-group>
                    </a-form-item>
                   
                <a-form-item  v-bind="formItemLayoutWithOutLabel">
                    <a-button type="primary" @click="register">立即修改</a-button>
                </a-form-item>
            </a-form>
        </div>
    </div>
</template>

<script>
import { queryWithdrawCheck,updateWithdrawCheck } from '@/api/product';
export default {
    data () {
        return {
            brandId: this.global.brandId,
             isHideList: [
                { id: 1, name: '是'},
                { id: 0, name: '否'},
            ],
            formItemLayoutWithOutLabel: {
                wrapperCol: {
                    xs: { span: 24, offset: 0 },
                    sm: { span: 20, offset: 6 },
                },
            },
            status:'',
            brandList: [],
            
        };
    },
    created(){

    },
    methods: {
        getCoin(){
            var _this=this
             const params = {
                'brandId':_this.brandId,
            }
            queryWithdrawCheck(params)
            .then(res=>{
                if(res.success){
                     _this.status=res.data
                    _this.$notification['success']({
                        message: '提示',
                        description: '查询成功',
                        duration: 8,
                    })
                }else{
                    _this.$notification['error']({
                        message: '提示',
                        description: res.errMessage,
                        duration: 8,
                    })
                }
            })
               
        },
        register(){
            let _this = this
            if(!_this.brandId){
                _this.$message.warning('请选择品牌')
                return
            }
           
            const params1 = {
                'brandId':_this.brandId,
                'awardCoin':_this.signCoin,
            }
             const params2 = {
                'brandId':_this.brandId,
                'isWithdrawCheck':_this.status,
            }
            updateWithdrawCheck(params2)
            .then(res=>{
                if(res.success){
                     _this.getCoin()
                    _this.$notification['success']({
                        message: '提示',
                        description: '修改成功',
                        duration: 8,
                    })
                }else{
                    _this.$notification['error']({
                        message: '提示',
                        description: res.errMessage,
                        duration: 8,
                    })
                }
            })
            
        },
    }
}

</script>
<style scoped>

</style>